package com.yu.boot2.rabbit;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author: zy
 * @date: 2018/7/4 下午5:28
 * @description:
 */
@Slf4j
@Component
public class RabbitReceiver {

    @RabbitListener(queues = "hello.queue1")
    public String processMessage1(String msg) {
        log.info(Thread.currentThread().getName() + " 接收到来自hello.queue1队列的消息：" + msg);
        return msg.toUpperCase();
    }

    @RabbitListener(queues = "hello.queue2")
    public void processMessage2(String msg) {
        log.info(Thread.currentThread().getName() + " 接收到来自hello.queue2队列的消息：" + msg);
    }
}